package com.java46.struts2.orderdetails.action;

import com.java46.struts2.base.action.BaseAction;
import com.java46.struts2.base.exception.BusinessException;
import com.java46.struts2.orderdetails.service.OrderDetailsService;
import org.apache.struts2.convention.annotation.Action;

import java.util.List;

/**
 * @ClassName OrderDetailsAction
 * @Description 订单详情操作
 * @Author zuxia
 * @Date 2018/7/18 10:42
 * @Vcrsion 1.0
 **/
public class OrderDetailsAction extends BaseAction {

    /**
    *@Author xiao
    *@Description //根据订单编号查询订单详情
    *@Date 10:51 2018/7/18
    *@Param []
    *@return java.lang.String
    */
    @Action(value = "querydetailsorderid")
    public String queryDetailsOrderid(){
        String orderid=null;
        //获取前台传递过来的订单编号
        try {
            orderid = request.getParameter("orderid");
        }catch (Exception e){
            throw new BusinessException("没有接收到数据");
        }
        List list = OrderDetailsService.queryDetailsOrderid(orderid);
        setSuccesResult(list);
        return "json";
    }

}
